cmake_minimum_required(VERSION 3.7.0) # 要求的cmake最低版本

project(qtUi_test) # 项目名称

set(CMAKE_CXX_STANDARD 17) # c++标准
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON) # qt相关的设置
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

include_directories("./src") # 源文件目录
aux_source_directory("./src" SRC) 
add_executable(MainWindow ${SRC}) # 从源文件目录生成可执行文件MainWindow

find_package(Qt6 COMPONENTS Widgets OpenGL OpenGLWidgets REQUIRED) # 库和包
target_link_libraries(MainWindow Qt6::Widgets Qt6::OpenGL Qt6::OpenGLWidgets) # 链接